package com.tripcube.ai.model.dto;

import com.fasterxml.jackson.annotation.JsonSetter;
import com.fasterxml.jackson.annotation.Nulls;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.tripcube.ai.serializer.EmptyStringToNullDeserializer;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import java.util.List;

/**
 * 添加文档请求参数DTO
 * 对应阿里百炼AddFile接口
 * @author alander
 */
@Data
@Schema(description = "添加文档请求参数")
public class AddFileDTO {

    /**
     * 文档解析器类型
     */
    @Schema(description = "文档解析器类型", example = "DASHSCOPE_DOCMIND")
    @JsonDeserialize(using = EmptyStringToNullDeserializer.class)
    @JsonSetter(nulls = Nulls.SKIP)
    private String parser = "DASHSCOPE_DOCMIND";

    /**
     * 文档分类ID
     */
    @NotBlank(message = "文档分类ID不能为空")
    @Schema(description = "文档分类ID")
    private String categoryId;

    /**
     * 分类类型
     */
    @NotBlank(message = "分类类型不能为空")
    @Schema(description = "分类类型", example = "UNSTRUCTURED")
    @JsonDeserialize(using = EmptyStringToNullDeserializer.class)
    @JsonSetter(nulls = Nulls.SKIP)
    private String categoryType = "UNSTRUCTURED";

    /**
     * 文档名称
     */
    @NotBlank(message = "文档名称不能为空")
    @Schema(description = "文档名称")
    private String fileName;

    /**
     * 文档来源URL
     */
    @NotBlank(message = "文档来源URL不能为空")
    @Schema(description = "文档来源URL")
    private String originalFileUrl;

    /**
     * 文档标签列表
     */
    @Schema(description = "文档标签列表（可选）")
    @JsonDeserialize(using = EmptyStringToNullDeserializer.class)
    @JsonSetter(nulls = Nulls.SKIP)
    private List<String> tags;
}